import {render,connect} from '../../../../../hrpub/common/frame';
import BtnAction from '../../actions/btn.js';
import NCBackBtn from "../../../../../hrpub/common/components/hr-back/index"
import TempAction from '../../actions/temp';
import PubAction from '../../actions/pub';


const Form = render({
    actions: {
        btnAction: BtnAction,
        tempAction: TempAction,
        pubAction: PubAction
    }
})(({props,action,state})=>{
    const {main,form,button,editTable} = props
    const {createForm} = form
    const {createButtonApp} =button
    const {createEditTable} = editTable
    return (
        <React.Fragment>
            <div style={{display: main.showPage === 'card'? '': 'none'}} className="nc-bill-card">
                <div className="header">
                    <NCBackBtn
                        style={{float: 'left' }}
                        onClick={action.btnAction.onBack}
                    ></NCBackBtn>
                    <div className="header-btn">
                        {createButtonApp({
                            area: 'card',
                            onButtonClick : action.btnAction.onButtonClick
                        })}
                    </div>
                </div>
                <div className='body-form'> 
                    {createForm('handcondform',{

                    })}
                </div>
                <div className="nc-bill-table-area">
                    {createEditTable('handitemsetgrid',{
                        onBeforeEvent: action.tempAction.onBeforeTableEvent,
                        adaptionHeight:true
                    })}
                </div>
            </div>
        </React.Fragment>
        
    )

})

export default connect(Form)